<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Direct3D 12 Memory Allocator: D3D12MA::Pool Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">Direct3D 12 Memory Allocator
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespace_d3_d12_m_a.html">D3D12MA</a></li><li class="navelem"><a class="el" href="class_d3_d12_m_a_1_1_pool.html">Pool</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_d3_d12_m_a_1_1_pool-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">D3D12MA::Pool Class Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Custom memory pool.  
 <a href="#details">More...</a></p>

<p><code>#include &lt;D3D12MemAlloc.h&gt;</code></p>
<div class="dynheader">
Inheritance diagram for D3D12MA::Pool:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_d3_d12_m_a_1_1_pool.png" alt=""/>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aaab59af46d922d6b81fce8d8be987028" id="r_aaab59af46d922d6b81fce8d8be987028"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html">POOL_DESC</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aaab59af46d922d6b81fce8d8be987028">GetDesc</a> () const</td></tr>
<tr class="memdesc:aaab59af46d922d6b81fce8d8be987028"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns copy of parameters of the pool.  <br /></td></tr>
<tr class="separator:aaab59af46d922d6b81fce8d8be987028"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa9d849dc4667314b2a53eddf02f5af91" id="r_aa9d849dc4667314b2a53eddf02f5af91"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aa9d849dc4667314b2a53eddf02f5af91">GetStatistics</a> (<a class="el" href="struct_d3_d12_m_a_1_1_statistics.html">Statistics</a> *pStats)</td></tr>
<tr class="memdesc:aa9d849dc4667314b2a53eddf02f5af91"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves basic statistics of the custom pool that are fast to calculate.  <br /></td></tr>
<tr class="separator:aa9d849dc4667314b2a53eddf02f5af91"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad07999ac5dc8f0c63187afd45d551910" id="r_ad07999ac5dc8f0c63187afd45d551910"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad07999ac5dc8f0c63187afd45d551910">CalculateStatistics</a> (<a class="el" href="struct_d3_d12_m_a_1_1_detailed_statistics.html">DetailedStatistics</a> *pStats)</td></tr>
<tr class="memdesc:ad07999ac5dc8f0c63187afd45d551910"><td class="mdescLeft">&#160;</td><td class="mdescRight">Retrieves detailed statistics of the custom pool that are slower to calculate.  <br /></td></tr>
<tr class="separator:ad07999ac5dc8f0c63187afd45d551910"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a20617cfec0461cf8c2b92115b5140c5b" id="r_a20617cfec0461cf8c2b92115b5140c5b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a20617cfec0461cf8c2b92115b5140c5b">SetName</a> (LPCWSTR Name)</td></tr>
<tr class="memdesc:a20617cfec0461cf8c2b92115b5140c5b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Associates a name with the pool. This name is for use in debug diagnostics and tools.  <br /></td></tr>
<tr class="separator:a20617cfec0461cf8c2b92115b5140c5b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a63c91d92a9ca48b98866a5cc1aea333b" id="r_a63c91d92a9ca48b98866a5cc1aea333b"><td class="memItemLeft" align="right" valign="top">LPCWSTR&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a63c91d92a9ca48b98866a5cc1aea333b">GetName</a> () const</td></tr>
<tr class="memdesc:a63c91d92a9ca48b98866a5cc1aea333b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the name associated with the pool object.  <br /></td></tr>
<tr class="separator:a63c91d92a9ca48b98866a5cc1aea333b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc87bb49c192de8f5a9ca0484c499575" id="r_adc87bb49c192de8f5a9ca0484c499575"><td class="memItemLeft" align="right" valign="top">HRESULT&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#adc87bb49c192de8f5a9ca0484c499575">BeginDefragmentation</a> (const <a class="el" href="struct_d3_d12_m_a_1_1_d_e_f_r_a_g_m_e_n_t_a_t_i_o_n___d_e_s_c.html">DEFRAGMENTATION_DESC</a> *pDesc, <a class="el" href="class_d3_d12_m_a_1_1_defragmentation_context.html">DefragmentationContext</a> **ppContext)</td></tr>
<tr class="memdesc:adc87bb49c192de8f5a9ca0484c499575"><td class="mdescLeft">&#160;</td><td class="mdescRight">Begins defragmentation process of the current pool.  <br /></td></tr>
<tr class="separator:adc87bb49c192de8f5a9ca0484c499575"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Custom memory pool. </p>
<p>Represents a separate set of heaps (memory blocks) that can be used to create <a class="el" href="class_d3_d12_m_a_1_1_allocation.html" title="Represents single memory allocation.">D3D12MA::Allocation</a>-s and resources in it. Usually there is no need to create custom pools - creating resources in default pool is sufficient.</p>
<p>To create custom pool, fill <a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html" title="Parameters of created D3D12MA::Pool object. To be used with D3D12MA::Allocator::CreatePool.">D3D12MA::POOL_DESC</a> and call <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#aac7b1f6bf53cbf4c4ce2264cb72ca515" title="Creates custom pool.">D3D12MA::Allocator::CreatePool</a>. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="adc87bb49c192de8f5a9ca0484c499575" name="adc87bb49c192de8f5a9ca0484c499575"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adc87bb49c192de8f5a9ca0484c499575">&#9670;&#160;</a></span>BeginDefragmentation()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">HRESULT D3D12MA::Pool::BeginDefragmentation </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="struct_d3_d12_m_a_1_1_d_e_f_r_a_g_m_e_n_t_a_t_i_o_n___d_e_s_c.html">DEFRAGMENTATION_DESC</a> *</td>          <td class="paramname"><span class="paramname"><em>pDesc</em>, </span></td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="class_d3_d12_m_a_1_1_defragmentation_context.html">DefragmentationContext</a> **</td>          <td class="paramname"><span class="paramname"><em>ppContext</em></span>&#160;)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Begins defragmentation process of the current pool. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir"></td><td class="paramname">pDesc</td><td>Structure filled with parameters of defragmentation. </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">ppContext</td><td>Context object that will manage defragmentation. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li><code>S_OK</code> if defragmentation can begin.</li>
<li><code>E_NOINTERFACE</code> if defragmentation is not supported.</li>
</ul>
</dd></dl>
<p>For more information about defragmentation, see documentation chapter: <a class="el" href="defragmentation.html">Defragmentation</a>. </p>

</div>
</div>
<a id="ad07999ac5dc8f0c63187afd45d551910" name="ad07999ac5dc8f0c63187afd45d551910"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad07999ac5dc8f0c63187afd45d551910">&#9670;&#160;</a></span>CalculateStatistics()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void D3D12MA::Pool::CalculateStatistics </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_d3_d12_m_a_1_1_detailed_statistics.html">DetailedStatistics</a> *</td>          <td class="paramname"><span class="paramname"><em>pStats</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieves detailed statistics of the custom pool that are slower to calculate. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">pStats</td><td>Statistics of the current pool. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aaab59af46d922d6b81fce8d8be987028" name="aaab59af46d922d6b81fce8d8be987028"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaab59af46d922d6b81fce8d8be987028">&#9670;&#160;</a></span>GetDesc()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="struct_d3_d12_m_a_1_1_p_o_o_l___d_e_s_c.html">POOL_DESC</a> D3D12MA::Pool::GetDesc </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"></span></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns copy of parameters of the pool. </p>
<p>These are the same parameters as passed to <a class="el" href="class_d3_d12_m_a_1_1_allocator.html#aac7b1f6bf53cbf4c4ce2264cb72ca515" title="Creates custom pool.">D3D12MA::Allocator::CreatePool</a>. </p>

</div>
</div>
<a id="a63c91d92a9ca48b98866a5cc1aea333b" name="a63c91d92a9ca48b98866a5cc1aea333b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a63c91d92a9ca48b98866a5cc1aea333b">&#9670;&#160;</a></span>GetName()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">LPCWSTR D3D12MA::Pool::GetName </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"></span></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Returns the name associated with the pool object. </p>
<p>Returned string points to an internal copy.</p>
<p>If no name was associated with the allocation, returns NULL. </p>

</div>
</div>
<a id="aa9d849dc4667314b2a53eddf02f5af91" name="aa9d849dc4667314b2a53eddf02f5af91"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa9d849dc4667314b2a53eddf02f5af91">&#9670;&#160;</a></span>GetStatistics()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void D3D12MA::Pool::GetStatistics </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_d3_d12_m_a_1_1_statistics.html">Statistics</a> *</td>          <td class="paramname"><span class="paramname"><em>pStats</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Retrieves basic statistics of the custom pool that are fast to calculate. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">pStats</td><td>Statistics of the current pool. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a20617cfec0461cf8c2b92115b5140c5b" name="a20617cfec0461cf8c2b92115b5140c5b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a20617cfec0461cf8c2b92115b5140c5b">&#9670;&#160;</a></span>SetName()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void D3D12MA::Pool::SetName </td>
          <td>(</td>
          <td class="paramtype">LPCWSTR</td>          <td class="paramname"><span class="paramname"><em>Name</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Associates a name with the pool. This name is for use in debug diagnostics and tools. </p>
<p>Internal copy of the string is made, so the memory pointed by the argument can be changed of freed immediately after this call.</p>
<p><code>Name</code> can be NULL. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>D:/PROJECTS/D3D12 Memory Allocator/REPO/include/<a class="el" href="_d3_d12_mem_alloc_8h.html">D3D12MemAlloc.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
</small></address>
</body>
</html>
